<?php

class Occupancy extends EMongoDocument {

    public $hotel;
    public $childOldFrom;
    public $childOldTo;
    public $freeChildren;
    public $minAge;
    public $roomType = array();

//    public function __construct($names) {
//        $this->roomType = $names;
//    }

    public function rules() {
        return array(
            array('hotel,childOldFrom,childOldTo,freeChildren,minAge', 'safe')
        );
    }

    public function attributeLabels() {
        return array(
            'hotel' => 'hotel',
            'childOldFrom' => 'childOldFrom',
            'childOldTo' => 'childOldTo',
            'freeChildren' => 'freeChildren',
            'minAge' => 'minAge'
        );
    }

//    public function embeddedDocuments() {
//        $arrRoomtype = MyFunctionCustom::getRoomtype();
//        $arr = array();
//        foreach ($arrRoomtype as $key => $rt) {
//            $arr[$key] = 'OccupancyRoomType';
//        }
//        return $arr;
//    }

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public function getCollectionName() {
        return 'occupancies';
    }
}

?>